///************************************************************************
/// <copyrigth>2018-2019 Corporation.All Rights Reserved</copyrigth>
/// <author>tangyingzhong</author>
/// <contact>tangyz114987@outlook.com</contact>
/// <version>v1.0.0</version>
/// <describe>
/// This plugin manager dutys for other plugins loading and unloading
///</describe>
/// <date>2019/7/25</date>
///***********************************************************************
#ifndef IPLUGINMANAGER_H
#define IPLUGINMANAGER_H

#include <string>
#include "IThreadPool.h"

#define PLUGIN_MANAGER_NAME "PluginManager"

#define PLUGIN_MANAGER_VERSION 1,0,0

#define PLUGIN_MANAGER_PLUGIN_BASE PLUGIN_MANAGER_NAME,PLUGIN_MANAGER_VERSION

#define MANAGER_IS_START_ON_LOAD true

#define MANAGER_IS_MAIN_SERVICE true

#define PLUGIN_MANAGER_PLUGIN PLUGIN_MANAGER_PLUGIN_BASE,MANAGER_IS_START_ON_LOAD,MANAGER_IS_MAIN_SERVICE

class IPluginManager :public IPlugin
{
public:
	// Virtual detructe the plugin manager
	virtual ~IPluginManager() {	}

public:
	// Set the thread pool
	virtual void SetPool(IThreadPool* pPool) = 0;

	// Start main service
	virtual bool StartMainService() = 0;

	// Get the plugin by name and version
	virtual IPlugin* GetPlugin(std::string strPluginName,
		int iMajorVersion,
		int iMinorVersion,
		int iModifyVersion) = 0;

	// Release the plugin
	virtual bool ReleasePlugin(IPlugin* pPlugin) = 0;
};
#endif // IPLUGINMANAGER_H
